<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha256-Z1K5uhUaJXA7Ll0XrZ/0JhX4lAtZFpT6jkKrEDT0drU=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"example.com","root":"/","images":"/images","scheme":"Muse","darkmode":false,"version":"8.14.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":-1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="1. 查看操作系统1cat &#x2F;etc&#x2F;issue  1lsb_release -a    2. 查看内存信息1cat &#x2F;proc&#x2F;meminfo  123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051# outputMemTotal:        4009020">
<meta property="og:type" content="article">
<meta property="og:title" content="Linux查看系统信息——内存、CPU、磁盘">
<meta property="og:url" content="http://example.com/2022/05/02/linux%E6%9F%A5%E7%9C%8B%E7%A1%AC%E4%BB%B6%E3%80%81%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF/index.html">
<meta property="og:site_name" content="JsyBlog">
<meta property="og:description" content="1. 查看操作系统1cat &#x2F;etc&#x2F;issue  1lsb_release -a    2. 查看内存信息1cat &#x2F;proc&#x2F;meminfo  123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051# outputMemTotal:        4009020">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-05-02T13:00:00.000Z">
<meta property="article:modified_time" content="2023-04-08T08:08:57.445Z">
<meta property="article:author" content="SongyangJi">
<meta property="article:tag" content="系统监控">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="http://example.com/2022/05/02/linux%E6%9F%A5%E7%9C%8B%E7%A1%AC%E4%BB%B6%E3%80%81%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"http://example.com/2022/05/02/linux%E6%9F%A5%E7%9C%8B%E7%A1%AC%E4%BB%B6%E3%80%81%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF/","path":"2022/05/02/linux查看硬件、系统信息/","title":"Linux查看系统信息——内存、CPU、磁盘"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Linux查看系统信息——内存、CPU、磁盘 | JsyBlog</title>
  








  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">JsyBlog</p>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#1-%E6%9F%A5%E7%9C%8B%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F"><span class="nav-number">1.</span> <span class="nav-text">1. 查看操作系统</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#2-%E6%9F%A5%E7%9C%8B%E5%86%85%E5%AD%98%E4%BF%A1%E6%81%AF"><span class="nav-number">2.</span> <span class="nav-text">2. 查看内存信息</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3-%E6%9F%A5%E7%9C%8BCPU%E4%BF%A1%E6%81%AF"><span class="nav-number">3.</span> <span class="nav-text">3. 查看CPU信息</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#4-%E6%9F%A5%E7%9C%8BCPU%E7%9A%84%E8%B4%9F%E8%BD%BD"><span class="nav-number">4.</span> <span class="nav-text">4. 查看CPU的负载</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#5-%E7%A1%AC%E7%9B%98"><span class="nav-number">5.</span> <span class="nav-text">5. 硬盘</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">SongyangJi</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">251</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">45</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">109</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/05/02/linux%E6%9F%A5%E7%9C%8B%E7%A1%AC%E4%BB%B6%E3%80%81%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="SongyangJi">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="JsyBlog">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="Linux查看系统信息——内存、CPU、磁盘 | JsyBlog">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Linux查看系统信息——内存、CPU、磁盘
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-05-02 21:00:00" itemprop="dateCreated datePublished" datetime="2022-05-02T21:00:00+08:00">2022-05-02</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-04-08 16:08:57" itemprop="dateModified" datetime="2023-04-08T16:08:57+08:00">2023-04-08</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="1-查看操作系统"><a href="#1-查看操作系统" class="headerlink" title="1. 查看操作系统"></a>1. 查看操作系统</h1><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat /etc/issue</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">lsb_release -a</span><br></pre></td></tr></table></figure>



<h1 id="2-查看内存信息"><a href="#2-查看内存信息" class="headerlink" title="2. 查看内存信息"></a>2. 查看内存信息</h1><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat /proc/meminfo</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">output</span></span><br><span class="line">MemTotal:        4009020 kB</span><br><span class="line">MemFree:          135628 kB</span><br><span class="line">MemAvailable:    1925688 kB</span><br><span class="line">Buffers:          282728 kB</span><br><span class="line">Cached:          1324092 kB</span><br><span class="line">SwapCached:         1612 kB</span><br><span class="line">Active:           807888 kB</span><br><span class="line">Inactive:        2533284 kB</span><br><span class="line">Active(anon):      43472 kB</span><br><span class="line">Inactive(anon):  1709556 kB</span><br><span class="line">Active(file):     764416 kB</span><br><span class="line">Inactive(file):   823728 kB</span><br><span class="line">Unevictable:        6976 kB</span><br><span class="line">Mlocked:               0 kB</span><br><span class="line">SwapTotal:       2097148 kB</span><br><span class="line">SwapFree:        2052092 kB</span><br><span class="line">Dirty:             16828 kB</span><br><span class="line">Writeback:             0 kB</span><br><span class="line">AnonPages:       1739820 kB</span><br><span class="line">Mapped:           482588 kB</span><br><span class="line">Shmem:             26376 kB</span><br><span class="line">KReclaimable:     385472 kB</span><br><span class="line">Slab:             458420 kB</span><br><span class="line">SReclaimable:     385472 kB</span><br><span class="line">SUnreclaim:        72948 kB</span><br><span class="line">KernelStack:       12944 kB</span><br><span class="line">PageTables:        22444 kB</span><br><span class="line">NFS_Unstable:          0 kB</span><br><span class="line">Bounce:                0 kB</span><br><span class="line">WritebackTmp:          0 kB</span><br><span class="line">CommitLimit:     4101656 kB</span><br><span class="line">Committed_AS:    6306356 kB</span><br><span class="line">VmallocTotal:   133143461888 kB</span><br><span class="line">VmallocUsed:       27320 kB</span><br><span class="line">VmallocChunk:          0 kB</span><br><span class="line">Percpu:             1360 kB</span><br><span class="line">HardwareCorrupted:     0 kB</span><br><span class="line">AnonHugePages:         0 kB</span><br><span class="line">ShmemHugePages:        0 kB</span><br><span class="line">ShmemPmdMapped:        0 kB</span><br><span class="line">FileHugePages:         0 kB</span><br><span class="line">FilePmdMapped:         0 kB</span><br><span class="line">CmaTotal:          32768 kB</span><br><span class="line">CmaFree:           30140 kB</span><br><span class="line">HugePages_Total:       0</span><br><span class="line">HugePages_Free:        0</span><br><span class="line">HugePages_Rsvd:        0</span><br><span class="line">HugePages_Surp:        0</span><br><span class="line">Hugepagesize:       2048 kB</span><br><span class="line">Hugetlb:               0 kB</span><br></pre></td></tr></table></figure>



<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">默认</span></span><br><span class="line">free</span><br></pre></td></tr></table></figure>



<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">              总计         已用        空闲      共享    缓冲/缓存    可用</span><br><span class="line">内存：     4009020     1889432      115696       26380     2003892     1917212</span><br><span class="line">交换：     2097148       46848     2050300</span><br></pre></td></tr></table></figure>



<h1 id="3-查看CPU信息"><a href="#3-查看CPU信息" class="headerlink" title="3. 查看CPU信息"></a>3. 查看CPU信息</h1><ol>
<li>查看物理CPU个数</li>
</ol>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat /proc/cpuinfo | grep &quot;physical id&quot; | sort | uniq | wc -l</span><br></pre></td></tr></table></figure>

<ol start="2">
<li>查看每个物理CPU中core的个数(即核数)</li>
</ol>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat /proc/cpuinfo | grep &quot;cpu cores&quot; | uniq</span><br></pre></td></tr></table></figure>

<ol start="3">
<li>查看逻辑CPU的个数</li>
</ol>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat /proc/cpuinfo | grep &quot;processor&quot; | wc -l</span><br></pre></td></tr></table></figure>

<ol start="4">
<li>查看CPU信息（型号）</li>
</ol>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c</span><br></pre></td></tr></table></figure>

<ol start="5">
<li>查看是否开启超线程技术（只有intel的处理器支持）<br>如果启用此技术那么，每个物理核心又可分为两个逻辑处理器。<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat /proc/cpuinfo | grep -e &quot;cpu cores&quot;  -e &quot;siblings&quot; | sort | uniq</span><br></pre></td></tr></table></figure>
如果cpu cores数量和siblings数量一致，则没有启用超线程，否则超线程被启用。</li>
</ol>
<h1 id="4-查看CPU的负载"><a href="#4-查看CPU的负载" class="headerlink" title="4. 查看CPU的负载"></a>4. 查看CPU的负载</h1><p>平均负载是指上一分钟同时处于就绪状态的平均进程数。</p>
<p>如果CPU Load等于CPU个数乘以核数，那么就说CPU正好满负载，再多一点，可能就要出问题了，有些任务不能被及时分配处理器，那要保证响应时间的话，最好要小于CPU个数X核数X0.7。</p>
<p>Load Average是指CPU的Load。它所包含的信息是在一段时间内CPU正在处理及等待CPU处理的进程数之和的统计信息，也就是CPU使用队列的长度的统计信息。<br>Load Average的值应该小于CPU个数X核数X0.7，<br>Load Average会有3个状态平均值，分别是1分钟、5分钟和15分钟平均Load。</p>
<p>如果1分钟平均出现大于CPU个数X核数的情况，还不需要担心；如果5分钟的平均也是这样，那就要警惕了；15分钟的平均也是这样，就要分析哪里出现问题，防范未然。<br>查看CPU负载信息，使用<code>top</code>命令</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">output</span></span><br><span class="line">top - 15:50:31 up 4 days, 23:43, 1 user, load average: 0.51, 0.29, 0.37</span><br><span class="line">Tasks: 492 total,  1 running, 490 sleeping,  1 stopped,  0 zombie</span><br><span class="line">Cpu(s): 6.4%us, 0.1%sy, 0.0%ni, 93.4%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st</span><br><span class="line">Mem: 65973912k total, 32468632k used, 33505280k free,  906712k buffers</span><br><span class="line">Swap: 41943032k total,  13204k used, 41929828k free, 6434448k cached</span><br></pre></td></tr></table></figure>


<blockquote>
<p> MacOS查看信息</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">top -l 1 | head -n 10</span><br></pre></td></tr></table></figure>
</blockquote>
<h1 id="5-硬盘"><a href="#5-硬盘" class="headerlink" title="5. 硬盘"></a>5. 硬盘</h1><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">fdisk -l</span><br><span class="line">fdisk -l |grep Disk</span><br></pre></td></tr></table></figure>


<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">output</span></span><br><span class="line">Disk /dev/sda: 500.1 GB, 500107862016 bytes</span><br><span class="line">255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors</span><br><span class="line">Units = sectors of 1 * 512 = 512 bytes</span><br><span class="line">Sector size (logical/physical): 512 bytes / 4096 bytes</span><br><span class="line">I/O size (minimum/optimal): 4096 bytes / 4096 bytes</span><br><span class="line">Disk identifier: 0x00023728</span><br><span class="line"></span><br><span class="line">   Device Boot      Start         End      Blocks   Id  System</span><br><span class="line">/dev/sda1   *        2048     2148351     1073152   83  Linux</span><br><span class="line">/dev/sda2         2148352    21680127     9765888   82  Linux swap / Solaris</span><br><span class="line">/dev/sda3        21680128   177930239    78125056   83  Linux</span><br><span class="line">/dev/sda4       177932286   976771071   399419393    5  Extended/dev/sda5       177932288   412305407   117186560   83  Linux</span><br><span class="line">/dev/sda6       412307456   976771071   282231808   83  Linux</span><br></pre></td></tr></table></figure>





<blockquote>
<p> <a target="_blank" rel="noopener" href="https://www.cnblogs.com/ggjucheng/archive/2013/01/14/2859613.html">https://www.cnblogs.com/ggjucheng/archive/2013/01/14/2859613.html</a></p>
</blockquote>
<p> 补：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line">uname -a # 查看内核/操作系统/CPU信息(含x86_64表示32位机器,i686表示32位机器)</span><br><span class="line">head -n 1 /etc/issue # 查看操作系统版本，是数字1不是字母L</span><br><span class="line">cat /proc/cpuinfo # 查看CPU信息的linux系统信息命令</span><br><span class="line">hostname # 查看计算机名的linux系统信息命令</span><br><span class="line">lspci -tv # 列出所有PCI设备</span><br><span class="line">lsusb -tv # 列出所有USB设备的linux系统信息命令</span><br><span class="line">lsmod # 列出加载的内核模块</span><br><span class="line">env # 查看环境变量资源</span><br><span class="line">free -m # 查看内存使用量和交换区使用量</span><br><span class="line">df -h # 查看各分区使用情况</span><br><span class="line">du -sh # 查看指定目录的大小</span><br><span class="line">grep MemTotal /proc/meminfo # 查看内存总量</span><br><span class="line">grep MemFree /proc/meminfo # 查看空闲内存量</span><br><span class="line">uptime # 查看系统运行时间、用户数、负载</span><br><span class="line">cat /proc/loadavg # 查看系统负载磁盘和分区</span><br><span class="line">mount | column -t # 查看挂接的分区状态</span><br><span class="line">fdisk -l # 查看所有分区</span><br><span class="line">swapon -s # 查看所有交换分区</span><br><span class="line">hdparm -i /dev/hda # 查看磁盘参数(仅适用于IDE设备)</span><br><span class="line">dmesg | grep IDE # 查看启动时IDE设备检测状况网络</span><br><span class="line">ifconfig # 查看所有网络接口的属性</span><br><span class="line">iptables -L # 查看防火墙设置</span><br><span class="line">route -n # 查看路由表</span><br><span class="line">netstat -lntp # 查看所有监听端口</span><br><span class="line">netstat -antp # 查看所有已经建立的连接</span><br><span class="line">netstat -s # 查看网络统计信息进程</span><br><span class="line">ps -ef # 查看所有进程</span><br><span class="line">top # 实时显示进程状态用户</span><br><span class="line">w # 查看活动用户</span><br><span class="line">id # 查看指定用户信息</span><br><span class="line">last # 查看用户登录日志</span><br><span class="line">cut -d: -f1 /etc/passwd # 查看系统所有用户</span><br><span class="line">cut -d: -f1 /etc/group # 查看系统所有组</span><br><span class="line">crontab -l # 查看当前用户的计划任务服务</span><br><span class="line">chkconfig –list # 列出所有系统服务</span><br><span class="line">chkconfig –list | grep on # 列出所有启动的系统服务程序</span><br><span class="line">rpm -qa # 查看所有安装的软件包</span><br><span class="line">cat /proc/cpuinfo ：查看CPU相关参数的linux系统命令</span><br><span class="line">cat /proc/partitions ：查看linux硬盘和分区信息的系统信息命令</span><br><span class="line">cat /proc/meminfo ：查看linux系统内存信息的linux系统命令</span><br><span class="line">cat /proc/version ：查看版本，类似uname -r</span><br><span class="line">cat /proc/ioports ：查看设备io端口</span><br><span class="line">cat /proc/interrupts ：查看中断</span><br><span class="line">cat /proc/pci ：查看pci设备的信息</span><br><span class="line">cat /proc/swaps ：查看所有swap分区的信息 </span><br></pre></td></tr></table></figure>


    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E7%B3%BB%E7%BB%9F%E7%9B%91%E6%8E%A7/" rel="tag"># 系统监控</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2022/05/02/ssh%E5%85%AC%E9%92%A5%E7%A7%81%E9%92%A5%E5%8E%9F%E7%90%86/" rel="prev" title="ssh公钥私钥原理">
                  <i class="fa fa-chevron-left"></i> ssh公钥私钥原理
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2022/05/06/Sdu-Devops-01/" rel="next" title="安装Docker、Harbor、Jenkins、Gitlab">
                  安装Docker、Harbor、Jenkins、Gitlab <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">SongyangJi</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>





  





</body>
</html>
